
package com.xtsoft.platform.task.service.impl;
import java.util.Date;

import com.xtsoft.platform.base.system.domain.SysUser;

import com.xtsoft.platform.task.domain.TaskBug;
import com.xtsoft.platform.task.domain.TaskBugTwo;
import com.xtsoft.platform.task.repository.TaskBugRepository;
import com.xtsoft.platform.task.repository.TaskBugTwoRepository;
import com.xtsoft.platform.task.service.TaskBugTwoService;
import org.springframework.beans.factory.annotation.Autowired;
/*
*    上海信拓信息技术有限公司 Koala企业综合信息管理系统
*    Copyright (C) 2010-2015 ShangHai XinTuo Software Inc.
*/
import org.springframework.stereotype.Service;

import com.xtsoft.core.service.impl.GenericServiceImpl;


@Service("TaskBugTwoService")
public class TaskBugTwoServiceImpl extends GenericServiceImpl<TaskBugTwo,String, TaskBugTwoRepository> implements TaskBugTwoService {

	@Autowired
	private TaskBugRepository taskBugTwoRepository;
//	@Autowired
//	private CommonOperateRepository commonOperateRepository;

	@Override
	public void updateStateById(String indexId, int ids, SysUser sysUser, String descript) {
		// TODO Auto-generated method stub
		TaskBug taskBug=taskBugTwoRepository.getOne(indexId);
		taskBug.setUpdateTime(new Date().getTime());
		//操作动作
		String action="";
		String destring="";
		if(ids==1) {
			//已解决
			taskBug.setState(1);
			action="已解决";
			taskBug.setDescript(descript);
			destring=descript;
		}
		else if(ids==2) {
			//已确认
			taskBug.setState(2);
			action="已确认";
		}else if(ids==3) {
			//已关闭
			taskBug.setState(3);
			action="已关闭";
		}
		taskBugTwoRepository.save(taskBug);
//		CommonOperate commonOperate=new CommonOperate(action,TaskBug.class.getName(),sysUser.getUserId(),sysUser.getUsername(),taskBug.getTaskBugId(),new Date().getTime(),"");
//		commonOperateRepository.save(commonOperate);
	}

	
}